<template>
  <view>
    <view class="text">温馨提示：点击每一项查看详情</view>
    <scroll-view class="list_box">
      <view class="viewport_list" v-for="(question,index) in state.questions" :key="index">
        <navigator
          :url="`/pages/fallRiskReports/components/fallReportDetails/fallReportDetails?mark=${question.mark}&times=${question.times}&createTime=${question.createTime}&nickName=${userInfo.nickName}`"
          open-type="navigate"
          hover-class="none"
        >
        <view hover-class="none" class="item">
              <text class="text_box">
                跌倒风险报告_{{ userInfo.nickName }}_第{{ question.times }}次评估
              </text>
              <br>
              <text class="text_box">
                _{{ question.createTime }}_深圳大学附属华南医院
              </text>
          </view>
        </navigator>
      </view>
    </scroll-view>
  </view>
</template>

<script setup lang="ts">
import {ref,reactive,computed} from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import {getUserHistoryListApi,getUserHistoryApi} from '@/apis/userHistory/userHistory'
import {useMemberStore} from '@/stores/modules/member'
const options = reactive([
  {
    id:1,
    name:'张三',
    age:19,
    place:'骨科',
    nurse:'小红',
    comeTime:'2022-05-24',
    url:'',
    icon2:'iconfont icon-arrow'
  },
  {
    id:2,
    name:'张三',
    age:19,
    place:'骨科',
    nurse:'小红',
    comeTime:'2022-05-24',
    url:'',
    icon2:'iconfont icon-arrow'
  },
  {
    id:3,
    name:'张三',
    age:19,
    place:'骨科',
    nurse:'小红',
    comeTime:'2022-05-24',
    url:'',
    icon2:'iconfont icon-arrow'
  }
])
const memberStore = useMemberStore()
const {userInfo} = memberStore
const state = reactive({
  questions:[]
})
const getAllReport =async ()=>{
  const res= await getUserHistoryListApi()
  state.questions = res.data
  console.log('风险报告:',res.msg)
}
onLoad(()=>{
  getAllReport()
})
</script>

<style lang="scss" scoped>
page{
  background-color: #fff;
}
.text{
  color: red;
  margin-top: 25rpx;
  margin-left: 65rpx;
  font-size: 25rpx;
  font-weight: bold;
}
.list_box{
  margin-top: 50rpx;
  .viewport_list {
  margin-left: 25rpx;
  margin-right: 25rpx;
  .item {
    margin-bottom: 15rpx;
    margin-left: 40rpx;
    margin-right: 40rpx;
    color: rgb(0,111,255);
    position: relative;
    line-height: 60rpx;
    font-size: 25rpx;
    border-top: 1rpx solid #F5F5F5;
    border-radius: 20rpx;
    background-color: rgb(246,246,246);
    padding: 15rpx;
    .text_box{
      
    }
  }
}
}

</style>